<html>
    <head>
        <title>jQuery Toggle Command Example</title>
        <script src="http://code.jquery.com/jquery-latest.js"></script>
        <script type="text/javascript">
            $(function(){
                $('#obama').toggle(
                    function(event) {
                        $(event.target)
                        .css('opacity',0.4);
                    },
                    function(event) {
                        $(event.target)
                        .css('opacity',1.0);
                    }
                );
            });
        </script>
    </head>
    <body>
    <img id="obama" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Official_portrait_of_Barack_Obama.jpg/220px-Official_portrait_of_Barack_Obama.jpg"/>
    </body>
</html>
